<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			.div{
				width: 300px;
				height: 300px;
				background-color: #000000;
				margin-left: 40%;
				color: white;
			}
			.div1{
				width: 300px;
				height: 300px;
				background-color: pink;
				border: 20px solid red;
				color: red;
			}
		</style>
	</head>
	<body>
		<div class="div">鼠标移入改变样式，鼠标移除恢复。</div>
		<script type="text/javascript">
			$(function(){
				$(".div").hover(
				function(){
					$(".div").addClass("div1");
				},
				function(){
					$(".div").removeClass("div1");
				})
			})
		</script>
	</body>
</html>
